const mongoose = require("../db/index");

const UserSchema = mongoose.Schema(
  {
    username: {
      type: String,
      required: true,
      unique: true,
    },
    password: {
      type: String,
      required: true,
    },
    age: Number,
    city: String,
    gender: {
      type: Number,
      default: 0, //0保密 1男 2 女
    },
  },
  { timestapms: true }
);

const UserModel = mongoose.model("user", UserSchema);

module.exports = UserModel;
